﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using PromptDll;

namespace NikeSale.Ull
{
    /// <summary>
    /// 辅助功能函数类
    /// </summary>
    public static class Methods
    {
        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

        /// <summary>
        ///指定窗体能被拖动
        /// </summary>
        /// <param name="hwnd">指定窗体的句柄</param>
        public static void FormMove(IntPtr hwnd)
        {
            ReleaseCapture();
            SendMessage(hwnd, 0x0112, 0xF010 + 0x0002, 0);
        }

        /// <summary>
        /// 显示一条桌面信息
        /// </summary>
        /// <param name="text"></param>
        /// <param name="time"></param>
        /// <param name="len"></param>
        public static void ShowPrompt(string text,int time=2000,int len = 15)
        {
            TaskWork.ShowPrompt(text, time, len);
        }
    }
}
